package com.zhf.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 郑海飞
 * @version 1.0
 * @description:
 * @date 2024/3/27 10:19
 */
@Data
@Document(indexName = "tb_user",shards = 1,replicas = 1)
public class EsUser implements Serializable {
    @Id
    @Field(type = FieldType.Integer)
    private Integer id;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String uname;
    @Field(type = FieldType.Keyword)
    private String number;
    @Field(type = FieldType.Keyword)
    private String url;
    @Field(type = FieldType.Keyword)
    private String mobile;
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @Field(type = FieldType.Integer)
    private Integer tid;
    @Field(type = FieldType.Integer)
    private Integer role;
    @Field(type = FieldType.Keyword)
    private String tname;
}
